package com.wbt.observer;

/**
 * @author daojin
 * @date 2022/3/31 5:37 下午
 */
public class TestObserver {

    public static void main(String[] args) {
        ConcreteSubject concreteSubject = new ConcreteSubject();
        concreteSubject.addObserver(new ConcreteObserver());
        concreteSubject.addObserver(new SonObserver());
        // 被观察者发出消息
        concreteSubject.sendMsg("hello world!");
    }
}
